import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import 'wang-wujie';

if (window.__POWERED_BY_WUJIE__) {
  let instance: any;
  window.__WUJIE_MOUNT = async () => {
    instance = await bootstrapApplication(AppComponent, appConfig)
        .catch((err) => console.error(err));
  };
  window.__WUJIE_UNMOUNT = () => {
    instance.destroy?.();
  };
} else {
  bootstrapApplication(AppComponent, appConfig)
      .catch((err) => console.error(err));
}
